# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=pytest-runner
pkgbase=python-${_realname}
pkgname=("python-${_realname}")
pkgver=5.2
pkgrel=2
pkgdesc="Invoke py.test as distutils command with dependency resolution"
arch=('any')
license=('MIT')
url="https://github.com/pytest-dev/pytest-runner"
depends=('python-pytest')
makedepends=('python-setuptools-scm')
provides=("python3-${_realname}")
replaces=("python3-${_realname}")
conflicts=("python3-${_realname}")
source=("$pkgbase-$pkgver.tar.gz::https://github.com/pytest-dev/pytest-runner/archive/${pkgver}.tar.gz")
sha512sums=('0ce9c191481ab97795d0f45bdea7669cb61c3ac6aac476954d34c3e09e6fb08fd6bf73f192c014cb7ff2bd90dbfeb0f01d9a9ba7a9c6caeb371e40b42b558d63')

prepare() {
  export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
}

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  /usr/bin/python setup.py build
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  /usr/bin/python setup.py install --root="${pkgdir}" --optimize=1
  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
